package com.ruoyi.web.controller.eleme;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.entity.ElemePromotionVenue;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.service.eleme.ElemeService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName ElemeController
 * @Author 任宝坤
 * @Date 2025/9/1 16:15
 * @Version v1.0
 **/
@RestController
@RequestMapping("/ele")
public class ElemeController extends BaseController {
    @Resource
    private ElemeService elemeService;

    @PostMapping("/add")
    public AjaxResult add(@RequestBody ElemePromotionVenue venue) {
        return elemeService.add(venue);
    }

    @GetMapping("/list")
    public TableDataInfo list() {
        startPage();
        List<ElemePromotionVenue> list = elemeService.list();
        return getDataTable(list);
    }
}
